import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
import {format, fromUnixTime} from "date-fns";
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '创建日期',
    align: "center",
    sorter: true,
    dataIndex: 'createTime'
  },
  {
    title: '关联工厂',
    align: "center",
    dataIndex: 'factoryId_dictText',
    resizable:true
  },
  {
    title: '入库单号',
    align: "center",
    dataIndex: 'orderNo',
    resizable:true
  },
  {
    title: '制单时间',
    align: "center",
    sorter: true,
    dataIndex: 'makingTime',
    customRender: ({ text }) => {
      return format(fromUnixTime(text.substring(0, text.length - 3)), 'yyyy-MM-dd HH:mm:ss');
    },
    resizable:true
  },
  {
    title: '数量',
    align: "center",
    dataIndex: 'num',
    resizable:true
  },
  {
    title: '货品编号',
    align: "center",
    dataIndex: 'goodsNo',
    resizable:true
  },
  {
    title: '需要人工核对',
    align: "center",
    dataIndex: 'checking_dictText',
    resizable:true
  },
  {
    title: '是否核对成功',
    align: "center",
    dataIndex: 'succeed_dictText',
    resizable:true
  },
  {
    title: '详情信息',
    align: "center",
    dataIndex: 'details',
    resizable:true
  },
];

// 高级查询数据
export const superQuerySchema = {
  createTime: {title: '创建日期',order: 0,view: 'datetime', type: 'string',},
  orderNo: {title: '入库单号',order: 1,view: 'text', type: 'string',},
  makingTime: {title: '制单时间',order: 2,view: 'text', type: 'string',},
  num: {title: '数量',order: 3,view: 'text', type: 'string',},
  goodsNo: {title: '货品编号',order: 4,view: 'text', type: 'string',},
  specNo: {title: '规格码',order: 5,view: 'text', type: 'string',},
  succeed: {title: '是否核对成功',order: 6,view: 'number', type: 'number',dictCode: 'yn',},
  details: {title: '详情信息',order: 7,view: 'text', type: 'string',},
};
